#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
权限降级-升级联动机制模块
"""

from .core import PrivilegeEscalationModule
from ..base import PersistenceConfig, PersistenceResult, PersistenceStatus, PersistenceLevel

# 模块信息
__version__ = "1.0.0"
__author__ = "privilege-maDev Team"
__description__ = "权限降级-升级联动机制模块"

def create_module():
    """创建权限降级-升级联动机制模块实例"""
    return PrivilegeEscalationModule()

def get_module_info():
    """获取模块信息"""
    return {
        'name': 'privilege_escalation',
        'version': __version__,
        'author': __author__,
        'description': __description__,
        'supported_platforms': ['linux'],
        'persistence_types': ['privilege_escalation'],
        'stealth_levels': list(range(1, 11)),
        'requires_root': False,
        'requires_compilation': False,
        'dependencies': ['python3']
    }

def is_available():
    """检查模块是否可用"""
    import os
    import platform
    
    # 检查是否为 Linux 系统
    if os.name != 'posix':
        return False
    
    # 检查是否为支持的 Linux 发行版
    try:
        system = platform.system().lower()
        if system == 'linux':
            return True
    except:
        pass
    
    return False

__all__ = ['PrivilegeEscalationModule', 'create_module', 'get_module_info', 'is_available']